home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Conversion / Convert_PICT / Convert PICT.app / UncommentedPSCode / Ovals < prev    next >
Text File  |  1994-05-24  |  2KB  |  116 lines

  1. %BEGIN Ovals
  2. /ovalpath
  3. {
  4.     /lastright exch def
  5.     /lastbottom exch def
  6.     /lastleft exch def
  7.     /lasttop exch def
  8.     newpath
  9.         lastright lastleft sub    % compute width & height
  10.         lastbottom lasttop sub
  11.         lastbottom lastleft setupForArcPath
  12.         0 360 arc
  13.     closepath
  14. } def
  15. /frameOval
  16. {
  17.     /lastright exch def
  18.     /lastbottom exch def
  19.     /lastleft exch def
  20.     /lasttop exch def
  21.     
  22.     gsave
  23.         penPattern usePattern
  24.         
  25.         /thewidth lastright lastleft sub def
  26.         /theheight lastbottom lasttop sub def
  27.         penHeight 1 eq
  28.         penWidth 1 eq
  29.         and
  30.         {
  31.             newpath
  32.                 thewidth theheight lastbottom lastleft setupForArcPath
  33.                 0 360 arc
  34.             closepath
  35.             stroke
  36.         }
  37.         {
  38.             penHeight 0 gt    % don't draw with a 0 sized pen.
  39.             penWidth 0 gt
  40.             and
  41.             {
  42.                 /startmatrix  matrix  currentmatrix def
  43.                 newpath
  44.                     thewidth theheight lastbottom lastleft setupForArcPath
  45.                     0 360 arc
  46.                 closepath
  47.                     startmatrix setmatrix
  48.                     /innerRight lastright penWidth sub 1 add def
  49.                     /innerTop  lasttop penHeight add 1 sub def
  50.                     /innerLeft lastleft penWidth add 1 sub def
  51.                     /innerBottom lastbottom penHeight sub 1 add def
  52.                     /innerWidth innerRight innerLeft sub def
  53.                     /innerHeight innerBottom innerTop sub def
  54.                     
  55.                     innerWidth innerHeight innerBottom innerLeft
  56.                     setupForArcPath
  57.                     360 0  arcn
  58.                 closepath
  59.                 fill
  60.             }
  61.             if
  62.         }
  63.         ifelse
  64.     grestore
  65. } def
  66. /paintOval
  67. {
  68.     gsave
  69.         penPattern usePattern
  70.         ovalpath
  71.         fill
  72.     grestore
  73. }
  74. def
  75. /eraseOval
  76. {
  77.     gsave
  78.         backPattern usePattern
  79.         ovalpath
  80.         fill
  81.     grestore
  82. }
  83. def
  84. /invertOval
  85. {
  86.     gsave
  87.         ovalpath
  88.     grestore
  89. }
  90. def
  91. /fillOval
  92. {
  93.     gsave
  94.         fillPattern usePattern
  95.         ovalpath
  96.         fill
  97.     grestore
  98. }
  99. def
  100. /frameSameOval
  101.     { lasttop lastleft lastbottom lastright frameOval }
  102. def
  103. /paintSameOval
  104.     { lasttop lastleft lastbottom lastright paintOval }
  105. def
  106. /eraseSameOval
  107.     { lasttop lastleft lastbottom lastright eraseOval }
  108. def
  109. /invertSameOval
  110.     { lasttop lastleft lastbottom lastright invertOval }
  111. def
  112. /fillSameOval
  113.     { lasttop lastleft lastbottom lastright fillOval }
  114. def
  115. %END Ovals
  116.